a high-memory page. Otherwise stale writable mappings may
persist. This fixes a corner case for alloc_ldt (which can
vmalloc an LDT and hence use highmem pages).
Signed-off-by: Keir Fraser <keir@xensource.com>
if ((unsigned long)va >= (unsigned long)high_memory) {
unsigned long pfn = pte_pfn(*pte);
#ifdef CONFIG_HIGHMEM
- if (pfn < highstart_pfn)
+ if (pfn >= highstart_pfn)
+ kmap_flush_unused(); /* flush stale writable kmaps */
+ else
#endif
make_lowmem_page_readonly(
phys_to_virt(pfn << PAGE_SHIFT));